Integrand size = 12, antiderivative size = 167 \[ \int (a+b \tan (c+d x))^n \, dx=\frac {b \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{2 \sqrt {-b^2} \left (a-\sqrt {-b^2}\right ) d (1+n)}-\frac {b \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{2 \sqrt {-b^2} \left (a+\sqrt {-b^2}\right ) d (1+n)} \]
[Out]
Time = 0.11 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3566, 726, 70} \[ \int (a+b \tan (c+d x))^n \, dx=\frac {b (a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right )}{2 \sqrt {-b^2} d (n+1) \left (a-\sqrt {-b^2}\right )}-\frac {b (a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right )}{2 \sqrt {-b^2} d (n+1) \left (a+\sqrt {-b^2}\right )} \]
[In]
[Out]
Rule 70
Rule 726
Rule 3566
Rubi steps \begin{align*} \text {integral}& = \frac {b \text {Subst}\left (\int \frac {(a+x)^n}{b^2+x^2} \, dx,x,b \tan (c+d x)\right )}{d} \\ & = \frac {b \text {Subst}\left (\int \left (\frac {\sqrt {-b^2} (a+x)^n}{2 b^2 \left (\sqrt {-b^2}-x\right )}+\frac {\sqrt {-b^2} (a+x)^n}{2 b^2 \left (\sqrt {-b^2}+x\right )}\right ) \, dx,x,b \tan (c+d x)\right )}{d} \\ & = -\frac {b \text {Subst}\left (\int \frac {(a+x)^n}{\sqrt {-b^2}-x} \, dx,x,b \tan (c+d x)\right )}{2 \sqrt {-b^2} d}-\frac {b \text {Subst}\left (\int \frac {(a+x)^n}{\sqrt {-b^2}+x} \, dx,x,b \tan (c+d x)\right )}{2 \sqrt {-b^2} d} \\ & = \frac {b \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{2 \sqrt {-b^2} \left (a-\sqrt {-b^2}\right ) d (1+n)}-\frac {b \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{2 \sqrt {-b^2} \left (a+\sqrt {-b^2}\right ) d (1+n)} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.16 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.71 \[ \int (a+b \tan (c+d x))^n \, dx=\frac {\left ((a+i b) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-i b}\right )-(a-i b) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+i b}\right )\right ) (a+b \tan (c+d x))^{1+n}}{2 (a+i b) (i a+b) d (1+n)} \]
[In]
[Out]
\[\int \left (a +b \tan \left (d x +c \right )\right )^{n}d x\]
[In]
[Out]
\[ \int (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \]
[In]
[Out]
\[ \int (a+b \tan (c+d x))^n \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{n}\, dx \]
[In]
[Out]
\[ \int (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \]
[In]
[Out]
\[ \int (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \]
[In]
[Out]
Timed out. \[ \int (a+b \tan (c+d x))^n \, dx=\int {\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n \,d x \]
[In]
[Out]